-
Notifications
You must be signed in to change notification settings - Fork 37
[김혜선] Sprint4 #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[김혜선] Sprint4 #124
The head ref may contain hidden characters: "Basic-\uAE40\uD61C\uC120-sprint4"
Conversation
withyj-codeit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스프린트 미션 하느라 수고하셨어요👏🏻

Pull Request 만들 때, upstream/main이 아닌 upstream/Basic-김혜선 으로 만드셔야 하는 거 기억해 주세요.
뭔가 공통 부분들을 정리하고, 객체를 이용해서 태그들을 정리해서 가져오고 이렇게 하고 싶은데 일단 거기까지는 못했고, 우선 이렇게라도 기능을 구현해 보았습니다. js파일을 각각 나누고 싶지 않았는데 제가 보기 어지러워서 나눴습니다 ㅜ
시간이 빡빡할 때, 기능 먼저 구현하는 것 좋아요. 현재 혜선님 스프린트 미션 진도가 빠르셔서 여유되면, 해보려고 했던 작업 해보시면 좋을 것 같아요. login, signup에서 중복된 기능들은 따로 분리도 해보시면 좋은 경험이 될 것 같아요.
요구사항 중 활성화된 버튼을 누르면 다른 페이지로의 이동에서, form태그 내에 button type = "submit" 으로 했더니 페이지 이동이 안되서 type = "button" 으로 넣었는데 type="submit"일 때 페이지 이동은 어떻게 하는 것인지요....ㅜ
form에 action 속성 또는 button에 formaction으로 url 이동할 수 있고,
submit 이벤트 핸들링에서 preventDefault()로 브라우저 기본동작을 막고, 로그인 로직 처리하고 페이지 이동하셔도 돼요.
button type="submit" 이 없다면 form은 제출이 안되는 건가요? 아니면 button type="button"이라도 또 다른 이벤트를 걸어 submit 시켜야 하는 건가요?
submit이 아닌 type="button" 이라도 onclick에 제출 관련 로직을 넣으면 제출가능해요.
브라우저에 기본동작을 활용해 제출하지 않는 경우도 많지만,
이 경우 type="submit"은 유지하고, preventDefault()로 기본 제출 동작을 막아서 사용하기도 해요.
| .error-txt { | ||
| padding-left: 16px; | ||
| font-size: 14px; | ||
| font-weight: var(--font-weight-semibold); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
필요하다고 생각하는 값 css 변수로 만들어 관리하는 것 좋아요~👍
| }; | ||
|
|
||
| // email validChk | ||
| function emailValidChk(email) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validateEmail 같은 함수 이름이 좋을 것 같아요.
| @@ -0,0 +1,118 @@ | |||
| //errMsg | |||
| const errMsg = { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
상수의 경우 ERR_MSG로 표현해주면 좋아요.
|
|
||
| // submit-btn disable, able | ||
| const submitBtn = document.querySelector('.submit-btn'); | ||
| function btnAble() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
동사로 시작하는 함수 이름이 좋아요.
요구사항
기본
로그인
회원가입
심화
주요 변경사항
스크린샷
netlify 배포 URL
https://stunning-madeleine-d08fba.netlify.app/
멘토에게